<form action="{:url()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="ConfigTable">
    <div class="layui-card-body">
        <div class="layui-form-item">
            <label class="layui-form-label">配置标识</label>
            <div class="layui-input-block">
                <input name="name" value="{$vo.name|default=''}" required vali-name="配置标识" placeholder="请输入配置标识" class="layui-input" type="text">
                <p class="help-block"><b>必填</b>，请填写分类名称 </p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置名称</label>
            <div class="layui-input-block">
                <input name="title" value="{$vo.title|default=''}" required vali-name="配置名称" placeholder="请输入配置名称" class="layui-input" type="text">
                <p class="help-block"><b>必填</b>，请填写分配置名称 </p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" required vali-name="排序" placeholder="请输入排序" value="{$vo.sort|default='50'}" class="layui-input">
                <p class="help-block">
                    <b>必须是数字排序越小越靠前</b>
                </p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置类型</label>
            <div class="layui-input-block">
                <select name='type' class='layui-select'>
                    <option value="0">数字</option>
                    {volist name="Think.config.global.CONFIG_TYPE_LIST" id="type"}
                    <option value="{$key}">{$type}</option>
                    {/volist}
                </select>
                <p class="help-block">
                    <b>（系统会根据不同类型解析配置值）</b>
                </p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置分组</label>
            <div class="layui-input-block">
                <select name='group' class='layui-select'>
                    <option value="0">不分组</option>
                    {volist name="Think.config.global.CONFIG_GROUP_LIST" id="group"}
                        <option value="{$key}">{$group}</option>
                    {/volist}
                </select>
                <p class="help-block">（配置分组 用于批量设置 不分组则不会显示在系统设置中）</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置值</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入配置值" class="layui-textarea" name="value" required vali-name="配置值">{$vo.value|default=""}</textarea>
                <p class="help-block">（配置值）</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置项</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入配置项" class="layui-textarea" name="extra">{$vo.extra|default=""}</textarea>
                <p class="help-block">（如果是枚举型 需要配置该项）</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">说明</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入说明" class="layui-textarea" name="remark">{$vo.remark|default=""}</textarea>
                <p class="help-block">（配置详细说明）</p>
            </div>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
<script type="text/javascript">
    $(function (){
        $.form.setValue("type","{$vo.type|default='0'}")
        $.form.setValue("group","{$vo.group|default='0'}")
    });
</script>